package fr.emn.fil.soc.gr3.entites;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class EvaluationPK implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6499390252808606548L;

	@Column(name="\"idCompte\"")
	private Integer idCompte;

	@Column(name="\"idSujet\"")
	private Integer idSujet;

	@Override
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idCompte.hashCode();
		hash = hash * prime + this.idSujet.hashCode();
		
		return hash;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof EvaluationPK){
			boolean res = ((EvaluationPK) obj).idCompte.equals(this.idCompte);
			res = res && ((EvaluationPK) obj).idSujet.equals(this.idSujet);
			return res;
		}
		else
		{
			return false;
		}
	}
	
	
}
